package chapter5;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  计算将来的学费
 * Date:2021/4/3
 * ***************************************************************
 */
public class exc5_7 {
	public static void main(String[] args) {
		double tuition=10000;
		for(int i=0;i<10;i++) {
			tuition*=1.05;
			
		}
		System.out.printf("After 10 years ,tuition is: %.2f\n ",tuition);
		double sum=0;
		for(int i=0;i<4;i++) {
			sum+=tuition;
			tuition=tuition*1.05;
		}
		System.out.printf("The total cost of 4 year is: %.2f \n",sum);
		
	}

}
